map: &mut HashMap<String, SourceId>,
config: &Config)
-> CargoResult<()> {
- assert!(root.package_id().source_id().is_path());
+ // If the root crate is *not* a path source, then we're probably in a
+ // situation such as `cargo install` with a lock file from a remote
+ // dependency. In that case we don't need to fixup any path dependencies (as
+ // they're not actually path dependencies any more), so we ignore them.
+ if !root.package_id().source_id().is_path() {
+ return Ok(())
+ }
let deps = root.dependencies()
.iter()
To learn more, run the command again with --verbose.
"));
});
+
+test!(git_with_lockfile {
+ let p = git::repo(&paths::root().join("foo"))
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+ authors = []
+
+ [dependencies]
+ bar = { path = "bar" }
+ "#)
+ .file("src/main.rs", "fn main() {}")
+ .file("bar/Cargo.toml", r#"
+ [package]
+ name = "bar"
+ version = "0.1.0"
+ authors = []
+ "#)
+ .file("bar/src/lib.rs", "fn main() {}")
+ .file("Cargo.lock", r#"
+ [root]
+ name = "foo"
+ version = "0.1.0"
+ dependencies = [ "b 0.1.0" ]
+
+ [[package]]
+ name = "bar"
+ version = "0.1.0"
+ "#);
+ p.build();
+
+ assert_that(cargo_process("install").arg("--git").arg(p.url().to_string()),
+ execs().with_status(0));
+});